home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / cmsrc392.zip / SYM.MF < prev    next >
Text File  |  1992-03-30  |  19KB  |  459 lines

  1. % This file generates the following characters when their codes are known:
  2. % |minus|, |plus_minus|, |o_plus|, |o_times|,
  3. % |cup|, |cap|, |meet|, |join|,
  4. % |down_arrow|, |up_arrow|,
  5. % |left_arrow|, |right_arrow|, |double_arrow|,
  6. % |subset|, |superset|, |elt|,
  7. % |for_all|, |there_exists|, |false_that|,
  8. % |less|, |greater|, |underbar|,
  9. % |neq|, |leq|, |geq|, |eqv|,
  10. % |backslash|, |vertical|,
  11. % |cdot|, |diamond|,
  12. % |left_brace|, |right_brace|,
  13. % |straight_quotes|, |infty|, |integral|.
  14.  
  15. iff known minus: cmchar "Minus sign";
  16. beginarithchar(minus); pickup rule.nib;
  17. lft x1=hround 1.5u-eps; x2=w-x1; y1=y2=math_axis;
  18. draw z1--z2;  % bar
  19. labels(1,2); endchar;
  20.  
  21. iff known plus_minus: cmchar "Plus-or-minus sign";
  22. beginarithchar(plus_minus); pickup rule.nib;
  23. numeric shiftup; shiftup=vround 1.5u;
  24. x1=x2=.5w; lft x3=lft x5=hround u-eps; x4=x6=w-x3;
  25. .5[y1,y2]=y3=y4=math_axis+shiftup; top y1=h+shiftup; y5=y6=y2;
  26. draw z1--z2;  % stem
  27. draw z3--z4;  % plus bar
  28. draw z5--z6;  % minus bar
  29. labels(1,2,3,4,5,6); endchar;
  30.  
  31. iff known o_plus: cmchar "Circle-plus operator";
  32. beginarithchar(o_plus); pickup light_rule.nib; autorounded;
  33. lft x6=hround u; x2=w-x6; y2=math_axis; top y8=h;
  34. circle_points; draw_circle;  % circle
  35. draw z2--z6; draw z4--z8;  % bar and stem
  36. labels(1,2,3,4,5,6,7,8); endchar;
  37.  
  38. iff known o_times: cmchar "Circle-times operator";
  39. beginarithchar(o_times); pickup light_rule.nib; autorounded;
  40. lft x6=hround u; x2=w-x6; y2=math_axis; top y8=h;
  41. circle_points; draw_circle;  % circle
  42. draw z1--z5; draw z3--z7;  % diagonals
  43. labels(1,2,3,4,5,6,7,8); endchar;
  44.  
  45. iff known cup: cmchar "Set union sign";
  46. beginchar(cup,12u#,.8asc_height#,0);
  47. italcorr .8asc_height#*slant-.5u#;
  48. adjust_fit(0,0); pickup rule.nib; autorounded;
  49. lft x1=hround u; x2=x1; x3=w-x3; x4=x5=w-x1;
  50. y1=good.y h+o; bot y3=-o; y2=y4=2/3[y1,y3]; y5=y1;
  51. draw z1---z2...z3...z4---z5;  % stems and cup
  52. labels(1,2,3,4,5); endchar;
  53.  
  54. iff known cap: cmchar "Set intersection sign";
  55. beginchar(cap,12u#,.8asc_height#,0);
  56. italcorr .8asc_height#*slant-.5u#;
  57. adjust_fit(0,0); pickup rule.nib; autorounded;
  58. lft x1=hround u; x2=x1; x3=w-x3; x4=x5=w-x1;
  59. y3=good.y h+o; bot y1=-o; y2=y4=2/3[y1,y3]; y5=y1;
  60. draw z1---z2...z3...z4---z5;  % stems and cap
  61. labels(1,2,3,4,5); endchar;
  62.  
  63. iff known meet: cmchar "Lattice infimum (logical and) sign";
  64. beginchar(meet,12u#,.8asc_height#,0);
  65. italcorr .8asc_height#*slant-.5u#;
  66. adjust_fit(0,0); pickup rule.nib;
  67. lft x1=hround u-eps; x3=w-x3; x5=w-x1;
  68. y3=good.y h+o; bot y1=-o; y5=y1;
  69. draw z1--z3--z5;  % diagonals
  70. labels(1,3,5); endchar;
  71.  
  72. iff known join: cmchar "Lattice supremum (logical or) sign";
  73. beginchar(join,12u#,.8asc_height#,0);
  74. italcorr .8asc_height#*slant-.5u#;
  75. adjust_fit(0,0); pickup rule.nib;
  76. lft x1=hround u-eps; x3=w-x3; x5=w-x1;
  77. y1=good.y h+o; bot y3=-o; y5=y1;
  78. draw z1--z3--z5;  % diagonals
  79. labels(1,3,5); endchar;
  80.  
  81. iff known down_arrow: cmchar "Downward arrow";
  82. beginchar(down_arrow,9u#,asc_height#,asc_depth#);
  83. adjust_fit(0,0); pickup crisp.nib;
  84. pos1(rule_thickness,0); pos2(rule_thickness,0);
  85. pos3(rule_thickness,90); pos4(rule_thickness,90);
  86. lft x1l=hround(.5w-.5rule_thickness); y1+.5rule_thickness=h;
  87. x0=x1=x2; bot y0=-d; x0-x3=x4-x0=if monospace:3u else:4u fi+eps;
  88. y3=y4=y0+if monospace:.24 else:.36 fi asc_height+eps;
  89. pos5(rule_thickness,angle(z4-z0)); z5l=z0;
  90. pos6(rule_thickness,angle(z3-z0)); z6l=z0;
  91. z9=.2[.5[z3,z4],z0];
  92. numeric t; path p; p=z4r{z9-z4}..z6r;
  93. t=xpart(p intersectiontimes((x2r,-d)--(x2r,h))); y2=ypart point t of p;
  94. filldraw z0..{z4-z9}z4l--subpath (0,t) of\\(z4r{z9-z4}..z6r)
  95.  --z2r---z1r..z1l---z2l--subpath (t,0) of\\(z3r{z9-z3}..z5r)
  96.  --z3l{z9-z3}..z0 & cycle;  % arrowhead and stem
  97. penlabels(0,1,2,3,4,5,6,9); endchar;
  98.  
  99. iff known up_arrow: cmchar "Upward arrow";
  100. beginchar(up_arrow,9u#,asc_height#,asc_depth#);
  101. italcorr .76asc_height#*slant+.5crisp#-u#;
  102. adjust_fit(0,0); pickup crisp.nib;
  103. pos1(rule_thickness,0); pos2(rule_thickness,0);
  104. pos3(rule_thickness,90); pos4(rule_thickness,90);
  105. lft x1l=hround(.5w-.5rule_thickness); y1-.5rule_thickness=-d;
  106. x0=x1=x2; top y0=h; x0-x3=x4-x0=if monospace:3u else:4u fi+eps;
  107. y3=y4=y0-if monospace:.24 else:.36 fi asc_height-eps;
  108. pos5(rule_thickness,angle(z4-z0)); z5l=z0;
  109. pos6(rule_thickness,angle(z3-z0)); z6l=z0;
  110. z9=.2[.5[z3,z4],z0];
  111. numeric t; path p; p=z4l{z9-z4}..z6r;
  112. t=xpart(p intersectiontimes((x2r,-d)--(x2r,h))); y2=ypart point t of p;
  113. filldraw z0..{z4-z9}z4r--subpath (0,t) of\\(z4l{z9-z4}..z6r)
  114.  --z2r---z1r..z1l---z2l--subpath (t,0) of\\(z3l{z9-z3}..z5r)
  115.  --z3r{z9-z3}..z0 & cycle;  % arrowhead and stem
  116. penlabels(0,1,2,3,4,5,6,9); endchar;
  117.  
  118. iff known left_arrow: cmchar "Leftward arrow";
  119. compute_spread(.45x_height#,.55x_height#);
  120. beginchar(left_arrow,18u#,v_center(spread#+rule_thickness#));
  121. adjust_fit(0,0); pickup crisp.nib;
  122. pos1(rule_thickness,90); pos2(rule_thickness,90);
  123. pos3(rule_thickness,0); pos4(rule_thickness,0);
  124. y0=y1=y2=math_axis; x1+.5rule_thickness=hround(w-u); lft x0=hround u;
  125. y3-y0=y0-y4=if monospace:.24 else:.36 fi asc_height+eps;
  126. x3=x4=x0+if monospace:3u else:4u fi+eps;
  127. pos5(rule_thickness,angle(z4-z0)); z5l=z0;
  128. pos6(rule_thickness,angle(z3-z0)); z6l=z0;
  129. z9=.2[.5[z3,z4],z0];
  130. numeric t; path p; p=z4r{z9-z4}..z6r;
  131. t=xpart(p intersectiontimes((0,y2l)--(w,y2l))); x2=xpart point t of p;
  132. filldraw z0..{z4-z9}z4l--subpath (0,t) of\\(z4r{z9-z4}..z6r)
  133.  --z2l---z1l..z1r---z2r--subpath (t,0) of\\(z3r{z9-z3}..z5r)
  134.  --z3l{z9-z3}..z0 & cycle;  % arrowhead and stem
  135. penlabels(0,1,2,3,4,5,6,9); endchar;
  136.  
  137. iff known right_arrow: cmchar "Rightward arrow";
  138. compute_spread(.45x_height#,.55x_height#);
  139. beginchar(right_arrow,18u#,v_center(spread#+rule_thickness#));
  140. adjust_fit(0,0); pickup crisp.nib;
  141. pos1(rule_thickness,90); pos2(rule_thickness,90);
  142. pos3(rule_thickness,0); pos4(rule_thickness,0);
  143. y0=y1=y2=math_axis; x1-.5rule_thickness=hround u; rt x0=hround(w-u);
  144. y3-y0=y0-y4=if monospace:.24 else:.36 fi asc_height+eps;
  145. x3=x4=x0-if monospace:3u else:4u fi-eps;
  146. pos5(rule_thickness,angle(z4-z0)); z5l=z0;
  147. pos6(rule_thickness,angle(z3-z0)); z6l=z0;
  148. z9=.2[.5[z3,z4],z0];
  149. numeric t; path p; p=z4l{z9-z4}..z6r;
  150. t=xpart(p intersectiontimes((0,y2l)--(w,y2l))); x2=xpart point t of p;
  151. filldraw z0..{z4-z9}z4r--subpath (0,t) of\\(z4l{z9-z4}..z6r)
  152.  --z2l---z1l..z1r---z2r--subpath (t,0) of\\(z3l{z9-z3}..z5r)
  153.  --z3r{z9-z3}..z0 & cycle;  % arrowhead and stem
  154. penlabels(0,1,2,3,4,5,6,9); endchar;
  155.  
  156. iff known double_arrow: cmchar "Left-and-right arrow";
  157. compute_spread(.45x_height#,.55x_height#);
  158. beginchar(double_arrow,18u#,
  159.  v_center(if monospace:.6asc_height#+fi spread#+rule_thickness#));
  160. adjust_fit(0,0); pickup crisp.nib;
  161. pos1(rule_thickness,90); pos2(rule_thickness,90);
  162. pos3(rule_thickness,0); pos4(rule_thickness,0);
  163. y0=y1=y2=math_axis if monospace:+vround.3asc_height fi; lft x0=hround u;
  164. if monospace: x1+.5rule_thickness=hround(w-u) else: x1=.5w fi;
  165. y3-y0=y0-y4=if monospace:.24 else:.36 fi asc_height+eps;
  166. x3=x4=x0+if monospace:3u else:4u fi+eps;
  167. pos5(rule_thickness,angle(z4-z0)); z5l=z0;
  168. pos6(rule_thickness,angle(z3-z0)); z6l=z0;
  169. z9=.2[.5[z3,z4],z0];
  170. numeric t; path p; p=z4r{z9-z4}..z6r;
  171. t=xpart(p intersectiontimes((0,y2l)--(w,y2l))); x2=xpart point t of p;
  172. filldraw z0..{z4-z9}z4l--subpath (0,t) of\\(z4r{z9-z4}..z6r)
  173.  --z2l---z1l..z1r---z2r--subpath (t,0) of\\(z3r{z9-z3}..z5r)
  174.  --z3l{z9-z3}..z0 & cycle;  % left arrowhead and stem
  175. pos11(rule_thickness,90); pos12(rule_thickness,90);
  176. pos13(rule_thickness,0); pos14(rule_thickness,0);
  177. y10=y11=y12=math_axis if monospace:-vround.3asc_height fi;
  178. rt x10=hround(w-u);
  179. if monospace: x11-.5rule_thickness=hround u else: x11=.5w fi;
  180. y13-y10=y10-y14=if monospace:.24 else:.36 fi asc_height+eps;
  181. x13=x14=x10-if monospace:3u else:4u fi-eps;
  182. pos15(rule_thickness,angle(z14-z10)); z15l=z10;
  183. pos16(rule_thickness,angle(z13-z10)); z16l=z10;
  184. z19=.2[.5[z13,z14],z10];
  185. numeric t; path p; p=z14l{z19-z14}..z16r;
  186. t=xpart(p intersectiontimes((0,y12l)--(w,y12l))); x12=xpart point t of p;
  187. filldraw z10..{z14-z19}z14r--subpath (0,t) of\\(z14l{z19-z14}..z16r)
  188.  --z12l---z11l..z11r---z12r--subpath (t,0) of\\(z13l{z19-z13}..z15r)
  189.  --z13r{z19-z13}..z10 & cycle;  % right arrowhead and stem
  190. penlabels(0,1,2,3,4,5,6,9,10,11,12,13,14,15,16,19); endchar;
  191.  
  192. iff known subset: cmchar "Proper subset sign";
  193. compute_spread(5/4x_height#,3/2x_height#);
  194. beginchar(subset,14u#,v_